<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:c="http://java.sun.com/jstl/core">
    <body>
        
    <ui:composition template="template/template.xhtml">

            <ui:define name="titulo">
                    Na Estrada
            </ui:define>

            <ui:define name="conteudo">

                <ui:repeat value="#{fotoController.aleatorio}" var="item" size="5">
                    <div>
                        
                    <h:panelGrid columns="1" cellpadding="2">
                        <h:panelGrid columns="1">
                            <h:panelGroup>                                
                                <h:outputText value="#{item.descricao}" styleClass="title">  
                                </h:outputText>                                  
                            </h:panelGroup>
                        </h:panelGrid>
                        
                        <h:graphicImage value="/imagens/#{item.caminho}" width="550" alt="#{item.idVeiculo.descricao}" />

                        <h:panelGrid columns="1">
                            <h:panelGroup>                   
                                <h:outputText value="#{item.idVeiculo.idMarca.descricao}" styleClass="title"></h:outputText> - 
                                <h:outputText value="#{item.idVeiculo.descricao}" styleClass="title"></h:outputText>
                            </h:panelGroup>
                        </h:panelGrid>                            
                        
                        <h:panelGrid columns="1">
                            <h:panelGroup>
                                Votos:
                                <h:outputText value="#{item.quantidade}" styleClass="title"></h:outputText>
                            </h:panelGroup>
                        </h:panelGrid>                        
                        
                        <h:panelGrid columns="1">
                            <h:panelGroup>
                                Nota: 
                                
                                <h:outputText value="#{item.nota}" styleClass="title">  
                                       <f:convertNumber maxFractionDigits="2" />  
                                </h:outputText>                                  
                            </h:panelGroup>
                        </h:panelGrid>

                        <h:panelGrid columns="1">
                            <h:panelGroup>
                                <h:selectOneRadio id="subscriptions" value="#{fotoController.nota}"> 
                                    <f:selectItem id="item1" itemLabel="1" itemValue="1" />
                                    <f:selectItem id="item2" itemLabel="2" itemValue="2" />
                                    <f:selectItem id="item3" itemLabel="3" itemValue="3" />
                                    <f:selectItem id="item4" itemLabel="4" itemValue="4" />
                                    <f:selectItem id="item5" itemLabel="5" itemValue="5" /> 
                                </h:selectOneRadio>                                
                                
				<h:commandLink 
						action="#{fotoController.votar}">
				  <h:outputText 
				  		value="Votar"  
				  		styleClass="text"/>
				  <f:param name="id" value="#{item.id}"/>

				</h:commandLink>                                 
                            </h:panelGroup>
                        </h:panelGrid>                        
                    </h:panelGrid>	
                    </div>
                </ui:repeat>

            </ui:define>
    </ui:composition>        
    </body>
</html>
